package com.qf.anno;

import com.qf.xml.service.UserService;
import com.qf.xml.service.impl.UserServiceImpl;
import com.qf.xml.service.impl.UserServiceImpl2;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service("usfb")
public class UserServiceFactoryBean implements FactoryBean<UserService> {

    //返回真正需要注入到spring容器中的对象
    @Override
    public UserService getObject() throws Exception {
        return new UserServiceImpl2();
    }

    //当前真正注入到spring容器中的对象的类型
    @Override
    public Class<?> getObjectType() {
        return UserService.class;
    }
}
